package com.znufe.exam.third.votesdk;

import com.sun.jna.Native;
import com.sun.jna.win32.StdCallLibrary;

import java.io.File;

public interface JVoteSdk extends StdCallLibrary
{
	JVoteSdk INSTANCE=(JVoteSdk)Native.loadLibrary("VoteSdk.dll",JVoteSdk.class);

	/**
	 *
	 * @param Mode 连接方式，0:USB方式,1:TCP/IP方式，2:服务器模式。
	 * @param BaseIP 基站IP地址，仅在Mode=1的情况下有效。
	 * @param OnConnect TCONNSTATE_EVENT，基站连接/断开事件回调
	 * @return 返回值：int，0:成功，-1:失败，该返回值仅表示函数执行是否成功。
	 */
	public int Connect(byte Mode, String BaseIP, JConnectCallback OnConnect);
	public int DisConnect(short BasementID);
	public int Stop(short BasementID, short KeyID);

	/**
	 *
	 * @param BasementID 基站编号
	 * @param KeyID 子键编号
	 * @param SigninKey 按键，0:OK键签到，1:任意键签到
	 * @param OnSignin 签到回调，有签到数据时会回调该函数
	 * @return
	 */
	public int Signin(short BasementID, short KeyID, byte SigninKey, JSigninCallback OnSignin);
	public int Vote(short BasementID, short KeyID, byte VoteMode, byte AllowEdit, byte SecrecyDelay, JVoteCallback OnVote);

	/**
	 *
	 * @param BasementID 基站编号
	 * @param KeyID 子键编号
	 * @param SelCount 总选择项，最大6，A80答题器，最大支持6
	 * @param Sel 可选项，最大6，同时不可超过SelCount，如果为1时表示单选，其他值表示多选。
	 * @param MustSel 必选项，最大6，同时不可超过Sel，该值表示必须选足该数量的项后，才可以提交，否则不予提交。
	 * @param DispMode 显示方式，0:数字显示，1:字母显示。
	 * @param AllowEdit 是否允许修改，0:不允许修改，1:允许修改。
	 * @param SecrecyDelay 延时保密时间，单位秒，0:不保密，其他值：在延时该值的时间后，屏幕消隐(保密状态)。
	 * @param OnChoices 选择回调，有选择数据时会回调该函数
	 * @return
	 */
	public int Choices( short BasementID, short KeyID, byte SelCount, byte Sel, byte MustSel, byte DispMode, byte AllowEdit, byte SecrecyDelay, JChoicesCallback OnChoices);
	public int Election(short BasementID, short KeyID, short ElectionCount, byte AllowEdit, byte SecrecyDelay, JElectionCallback OnElection);
	public int ElectionNameList(short BasementID, short KeyID, byte NameListID, byte Sel, byte MustSel, byte AllowEdit, byte SecrecyDelay, JElectionNameListCallback OnElectionNameList);
	public int Number(short BasementID, short KeyID, short LowScore, short HighScore, byte ValidPoint, byte AllowEdit, byte SecrecyDelay, JNumberCallback OnNumber);
	public int NumberNameList(short BasementID, short KeyID, byte NameListID, short LowScore, short HighScore, byte ValidPoint, byte AllowEdit, byte SecrecyDelay, JNumberNameListCallback OnNumberNameList);
	public int RushAnswer(short BasementID, short KeyID, byte RushAnswerKey, JRushAnswerCallback OnRushAnswer);
	public int FreeKey(short BasementID, short KeyID, byte DispMethod, byte UploadedClear, byte AllowEdit, byte SecrecyDelay, JFreeKeyCallback OnFreeKey);
	public int PowerDown(short BasementID, short KeyID, byte AllowPowerOn);
	public int Wakeup(short BasementID, short KeyID, JWakeupCallback OnWakeup);
	public int SetKeyID(short BasementID, short KeyID, byte SetKey, JKeyIDCallback OnKeyID);
	public int SetKeyParam(short BasementID, short KeyID, byte Sleep, byte Channel, short SystemMatchCode, JKeyParamCallback OnKeyParam);
	public int SetBasementParam(short BasementID, String Channels, short SystemMatchCode, JBasementParamCallback OnBasementParam);
	public int ReadVersion(short BasementID, short KeyID, JVersionCallback OnVersion);
	public int ReadPowerSignal(short BasementID, short KeyID, JPowerSignalCallback OnPowerSignal);
	public int SetBasementID(short OldBasementID, short NewBasementID, JBasementIDCallback OnBasementID);
	public int SetBasementIP(short BasementID, String IPAddress, String SubMask, JBasementIPCallback OnBasementIP);
	public int SetBasementMatchMode(short BasementID, byte Value, JBasementMatchModeCallback OnBasementMatchMode);
	public int Match(short BasementID, short KeyID, JMatchCallback OnMatch);
	public int Pause(short BasementID, short KeyID);
	public int Continue(short BasementID, short KeyID);
	public int DownLoadNames(short BasementID, String KeyIDs, String Value, JDownloadCallback OnDownload);
}